import React from 'react';

//路由懒加载
const Main = React.lazy(() => import("../pages/main"));
const Cart = React.lazy(() => import("../pages/cart"));
const Category = React.lazy(() => import("../pages/category"));
const Me = React.lazy(() => import("../pages/me"));
const Item = React.lazy(() => import("../pages/item"))
const List = React.lazy(()=>import('../pages/list'))
const Login = React.lazy(() => import('../pages/login'))

//配置路由表
const routes = [
    { path: "/main", component: Main },
    { path: "/cart", component: Cart },
    { path: "/category", component: Category },
    { path: "/me", component: Me },
    { path: "/item/:id", component: Item },
    {path: "/list", component: List },
    {path:"/login",component:Login},
    { from: "/", to: "/main" },
]

//输出
export default routes;